class Admin::CampaignAdvertsController < AdminController
 def index
    @campaign_adverts = CampaignAdvert.all
    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @campaign_adverts }
    end
  end
  
  
  def new
    @campaign_advert = CampaignAdvert.new
  end
  
   def destroy
    @campaign_advert = CampaignAdvert.find(params[:id])
    @campaign_advert.destroy
    flash_notice(:campaign_advert_removed)
    respond_to do |format|
      format.html { redirect_to(admin_campaign_adverts_url) }
      format.xml  { head :ok }
    end
  end
  
  def create
    @campaign_advert = CampaignAdvert.new(params[:campaign_advert]) 
    if @campaign_advert.save
      flash_notice(:campaign_advert_created)
      redirect_to admin_campaign_adverts_url
    else
      render :action=>:new
    end
  end
  
end
